{% extends "menu.html" %}
{% block content %}

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">



            </div>
            <div class="clearfix"></div>
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>新增文档</h2>

                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br />
                    <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" method="post">
                        {% csrf_token %}
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">作者<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="author" value="{{ my_name }}" readonly>
                        </div>
                      </div>
                    <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">文档时间<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="middle-name" class="date-picker form-control col-md-7 col-xs-12" required="required"  name="release_time" value="{{ release_time }}" readonly>
                        </div>
                      </div>
                    <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">标题<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="title">
                        </div>
                      </div>


                      <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">所属项目<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select name="project_list" class="col-md-6 col-sm-6 col-xs-12" size="10" style="width: 100%" multiple required>
                              {%  for project in project_list %}
                              <option value ="{{ project.id }}">{{ project.p_name }}</option>
                              {% endfor %}
                          </select>
                        </div>
                      </div>

                    <textarea id="article_content" name="article_content" style="text-align: center" required></textarea>





{#                        <textarea id="user_info" name="content" style="text-align: center"></textarea>#}


                    <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
                          <div class="col-md-6 col-sm-6 col-xs-12">
                          <span style="color: red">{{ result }}</span>
                        </div>
                      </div>

                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button class="btn btn-primary" type="button">取消</button>
						  <button class="btn btn-primary" type="reset">重置</button>
                          <button type="submit" class="btn btn-success">添加</button>
                        </div>

                      </div>


                    </form>
                  </div>
                </div>
              </div>
            </div>


          </div>
        </div>
    <script charset="utf-8" src="/static/kindeditor/kindeditor-all.js"></script>
    <script src="/static/kindeditor/lang/zh-CN.js"></script>
    <script>
    KindEditor.ready(function (K) {
        window.editor = K.create('#article_content',{
            width:'100%',
            height: '500px',
            uploadJson:'/upload/',
        {##表示传文件后的处理程序#}
            extraFileUploadParams:{
            "csrfmiddlewaretoken":"{{ csrf_token }}",
                {#上传文件的时候携带参数,由于csrf的原因需要携带csrf_token#}
        },
        })

    })
    </script>
{% endblock %}